package com.shenyong.ladmin.controller;

import com.shenyong.ladmin.entity.Blogroll;
import com.shenyong.ladmin.logConfig.Log;
import com.shenyong.ladmin.logConfig.OperationType;
import com.shenyong.ladmin.result.Page;
import com.shenyong.ladmin.service.BLogFriendService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author
 * @site
 * @company
 * @create
 */
@RestController
@RequestMapping("/BLogFriend")
public class BLogFriendController {
    @Autowired
    private BLogFriendService bLogFriendService;
    @RequiresAuthentication
    @RequestMapping("/BLogFrienfindAll")
    public Map<String, Object> BLogFrienfindAll(Page page){
        return bLogFriendService.BLogFrienfindAll(page);
    }
    @RequiresAuthentication
    @Log(describe = "添加友情链接",operationType= OperationType.INSERT)
    @RequestMapping("/BLogFriensave")
    public int BLogFriensave(Blogroll blogroll){
        return bLogFriendService.BLogFriensave(blogroll);
    }
    @RequiresAuthentication
    @Log(describe = "修改友情链接",operationType= OperationType.UPDATE)
    @RequestMapping("/BLogFrienUpdate")
    public int BLogFrienUpdate(Blogroll blogroll){
        return bLogFriendService.BLogFrienUpdate(blogroll);
    }
    @RequiresAuthentication
    @Log(describe = "删除友情链接",operationType= OperationType.DELETE)
    @RequestMapping("/BLogFrienDelete")
    public int BLogFrienDelete(int id){
        return bLogFriendService.BLogFrienDelete(id);
    }
}
